/**
 * 
 */
package it.robertobifulco.ias.test.repository;

import it.robertobifulco.ias.rolemanager.RoleRepository;
import it.robertobifulco.ias.rolemanager.RoleUndefinedException;

/**
 * @author Roberto Bifulco [info@robertobifulco.it, robertobifulco.it]
 *
 */
public class RoleRepositoryTEST implements RoleRepository {

	@Override
	public String[] getRoleOperations(String roleName)
			throws RoleUndefinedException {
		if(roleName.equals("Admin")){
			return new String[]{"read","write","execute"};
		} else if (roleName.equals("User")){
			return new String[]{"read","execute"};
		} else
			throw new RoleUndefinedException();
	}

	@Override
	public String[] getRoles() {
		return new String[]{"Admin","User"};
	}

}
